MS Teams Integration
Introduction
- Introduction to MS Team : Microsoft Teams is a collaboration platform developed by Microsoft, designed to facilitate communication and collaboration within teams and organizations. It offers a wide range of features aimed at improving teamwork, communication, and productivity. Microsoft Teams is used across diverse industries and businesses of all sizes to facilitate remote work, streamline communication, and enhance collaboration among team members, especially those working in distributed or remote setups.
What we need in env for Integration
- appId
- appPassword
Get App Id and App Password
- First we have to register an app in microsoft azure.
URL:
https://portal.azure.com/#view/Microsoft_AAD_IAM/ActiveDirectoryMenu Blade/~/RegisteredApps
- After creating the app, we get the app id and app password
- Then we have to create bot and paste the app id and webhook in it.
URL: https://dev.botframework.com/bots/new
What After Configuring Webhook ?
- We will start receiving request from microsoft teams.
- These requests are handled by teamsBotEmitter.js
Proactive messages
Proactive messages refer to messages that a bot can send to users without a prior user-initiated interaction. In other words, the bot can initiate a conversation or send a message to the user without waiting for the user to send a message first.
Proactive messages are useful in scenarios where a bot needs to send notifications, alerts, or updates to users, or when the bot needs to initiate a conversation based on specific events or triggers.
To send proactive messages, the bot needs to have access to the conversation reference, which includes information about the user, conversation, channel, and service URL. The conversation reference allows the bot to target and send messages to the specific user and conversation.
Type of buttons we handled
- openUrl: Used for redirecting to the given url
- Iamback: Used as a default button type
- Postback: Used for handling customSocketEvent
Custom Socket Event
- We will set the label value while sending the customsocketevent message to ms teams
- When user respond to that particular message, we get the value which we defined while sending the message.
- Then we assigned that custom value in preAnalyzeResponse in teamsBotManager.js
Publish your bot for teams
- Publish your bot as a Line of Business app in your organization's Teams Tenant App Catalog.
- Publish your bot as an app in the Teams App store.
Advantages of MS teams over other platforms
- We donβt have to merge quick replies in buttons as we can show quick replies same as website platform
- Limit of sending quick replies is 100
- We can send infinite buttons as there is no limit in cards in ms teams. One card can contains max 5 buttons
Limitations of MS teams
- We can only show 6 buttons in each card for carousel message type.
- Ms teams does not support audio and video message type.
- Limit of sending quick replies is 12.
Publish your bot for organization
- For publishing app on ms teams, we have to create a new app and add the app generated by microsoft azure on developers portal
- We can set the app icon and app versions and many more.
- After submitting the app for organization, admin have to approve the app (url: https://admin.teams.microsoft.com/)
- Admin can restrict or give app access for adding app to any user in the organization on admin portal.
Want to know more about Line Integration ?
- For more information you can check here